#ifndef __ALG_DEF_H__
#define __ALG_DEF_H__

#include <stdint.h>


#define ALG0_EN             (1<<0)
#define ALG1_EN             (1<<1)
#define ALG2_EN             (1<<2)
#define ALG3_EN             (1<<3)
#define ALG4_EN             (1<<4)
#define ALG5_EN             (1<<5)
#define ALG6_EN             (1<<6)
#define ALG7_EN             (1<<7)
#define ALG8_EN             (1<<8)
#define ALG9_EN             (1<<9)
#define ALG10_EN            (1<<10)
#define ALG11_EN            (1<<11)
#define ALG12_EN            (1<<12)
#define ALG13_EN            (1<<13)
#define ALG14_EN            (1<<14)
#define ALG15_EN            (1<<15)
#define ALG16_EN            (1<<16)
#define ALG17_EN            (1<<17)
#define ALG18_EN            (1<<18)
#define ALG19_EN            (1<<19)
#define ALG20_EN            (1<<20)
#define ALG21_EN            (1<<21)
#define ALG22_EN            (1<<22)
#define ALG23_EN            (1<<23)
#define ALG24_EN            (1<<24)
#define ALG25_EN            (1<<25)
#define ALG26_EN            (1<<26)
#define ALG27_EN            (1<<27)
#define ALG28_EN            (1<<28)
#define ALG29_EN            (1<<29)
#define ALG30_EN            (1<<30)
#define ALG31_EN            (1<<31)





#define ALG0_DIS             (0<<0)
#define ALG1_DIS             (0<<1)
#define ALG2_DIS             (0<<2)
#define ALG3_DIS             (0<<3)
#define ALG4_DIS             (0<<4)
#define ALG5_DIS             (0<<5)
#define ALG6_DIS             (0<<6)
#define ALG7_DIS             (0<<7)
#define ALG8_DIS             (0<<8)
#define ALG9_DIS             (0<<9)
#define ALG10_DIS            (0<<10)
#define ALG11_DIS            (0<<11)
#define ALG12_DIS            (0<<12)
#define ALG13_DIS            (0<<13)
#define ALG14_DIS            (0<<14)
#define ALG15_DIS            (0<<15)
#define ALG16_DIS            (0<<16)
#define ALG17_DIS            (0<<17)
#define ALG18_DIS            (0<<18)
#define ALG19_DIS            (0<<19)
#define ALG20_DIS            (0<<20)
#define ALG21_DIS            (0<<21)
#define ALG22_DIS            (0<<22)
#define ALG23_DIS            (0<<23)
#define ALG24_DIS            (0<<24)
#define ALG25_DIS            (0<<25)
#define ALG26_DIS            (0<<26)
#define ALG27_DIS            (0<<27)
#define ALG28_DIS            (0<<28)
#define ALG29_DIS            (0<<29)
#define ALG30_DIS            (0<<30)
#define ALG31_DIS            (0<<31)


#define COPY1_EN               (0x01)
#define COPY2_EN               (0x02)
#define COPY3_EN               (0x04)
#define COPY4_EN               (0x08)
#define COPY5_EN               (0x10)
#define COPY6_EN               (0x20)

#define FLASH_COPY1_EN               (0x01)
#define FLASH_COPY2_EN               (0x02)
#define FLASH_COPY3_EN               (0x04)
#define FLASH_COPY4_EN               (0x08)
#define FLASH_COPY5_EN               (0x10)
#define FLASH_COPY6_EN               (0x20)

#define ALG0_EN_MASK               (0x00000001)
#define ALG1_EN_MASK               (0x00000002)
#define ALG2_EN_MASK               (0x00000004)
#define ALG3_EN_MASK               (0x00000008)
#define ALG4_EN_MASK               (0x00000010)
#define ALG5_EN_MASK               (0x00000020)
#define ALG6_EN_MASK               (0x00000040)
#define ALG7_EN_MASK               (0x00000080)
#define ALG8_EN_MASK               (0x00000100)
#define ALG9_EN_MASK               (0x00000200)
#define ALG10_EN_MASK              (0x00000400)
#define ALG11_EN_MASK              (0x00000800)
#define ALG12_EN_MASK              (0x00001000)
#define ALG13_EN_MASK              (0x00002000)
#define ALG14_EN_MASK              (0x00004000)
#define ALG15_EN_MASK              (0x00008000)
#define ALG16_EN_MASK              (0x00010000)
#define ALG17_EN_MASK              (0x00020000)
#define ALG18_EN_MASK              (0x00040000)
#define ALG19_EN_MASK              (0x00080000)
#define ALG20_EN_MASK              (0x00100000)
#define ALG21_EN_MASK              (0x00200000)
#define ALG22_EN_MASK              (0x00400000)
#define ALG23_EN_MASK              (0x00800000)
#define ALG24_EN_MASK              (0x01000000)
#define ALG25_EN_MASK              (0x02000000)
#define ALG26_EN_MASK              (0x04000000)
#define ALG27_EN_MASK              (0x08000000)
#define ALG28_EN_MASK              (0x10000000)
#define ALG29_EN_MASK              (0x20000000)
#define ALG30_EN_MASK              (0x40000000)
#define ALG31_EN_MASK              (0x80000000)

#define FFT1D_MEAN_CUR             (0)
#define FFT1D_MEAN_OLD             (1)

#define CFAR1_EN                   (0)
#define CFAR2_EN                   (1)
#define CFAR12_EN                  (2)


typedef struct
{
	uint32_t srcAddr;
	uint32_t dstAddr;
	uint16_t srcInc;
	uint16_t dstInc;
	uint16_t mode;
	uint16_t len;
}COPY_CONFIG;
typedef struct
{
	uint32_t p2Cfg0;
	uint32_t p2Cfg1;
	uint32_t p2Cfg2;
	uint32_t p2Cfg3;
	uint32_t p2Cfg4;
	uint32_t p2Cfg5;
	uint32_t p2Cfg6;
	uint32_t p2Cfg7;
	uint32_t p2Cfg8;
	uint32_t fftCfg0;
	uint32_t fftCfg1;
	uint32_t fftCfg2;
}P2_FFT_CONFIG;
typedef struct
{
	uint32_t cfarCfg0;
	uint32_t cfarCfg1;
	uint32_t cfarCfg2;
	uint32_t cfarCfg3;
	uint32_t cfarCfg4;
	uint32_t cfarCfg5;
	uint32_t cfarCfg6;
	uint32_t cfarCfg7;
	uint32_t cfarCfg8;
}CFAR_CONFIG;
typedef struct
{
	uint32_t srcAddr;
	uint16_t intraCnt;
	uint16_t interCnt;
	uint32_t dstAddr;	
}FFT3D_PRE;
typedef struct
{
	P2_FFT_CONFIG alg0;
	P2_FFT_CONFIG alg1;
	P2_FFT_CONFIG alg2;
	P2_FFT_CONFIG alg3;
	P2_FFT_CONFIG alg4;
	P2_FFT_CONFIG alg5;
	P2_FFT_CONFIG alg6;
	P2_FFT_CONFIG alg7;
	P2_FFT_CONFIG alg8;
	P2_FFT_CONFIG alg9;
	P2_FFT_CONFIG alg13;
	P2_FFT_CONFIG alg14;
  P2_FFT_CONFIG alg15;		
  P2_FFT_CONFIG alg16;
  P2_FFT_CONFIG alg17;	
  P2_FFT_CONFIG alg18;	
  P2_FFT_CONFIG alg19;				
	P2_FFT_CONFIG alg21;
  P2_FFT_CONFIG alg22;			
  P2_FFT_CONFIG alg23;
  P2_FFT_CONFIG alg24;		
  P2_FFT_CONFIG alg25;		
  P2_FFT_CONFIG alg26;		
	CFAR_CONFIG alg10_cfar1;
	CFAR_CONFIG alg11_cfar2;	
	FFT3D_PRE alg12;
	FFT3D_PRE alg20;
	uint32_t algEn;    				  //012C

	//COPY
	COPY_CONFIG copy1;
	COPY_CONFIG copy2;
	COPY_CONFIG copy3;
	COPY_CONFIG copy4;
	COPY_CONFIG copy5;
	COPY_CONFIG copy6;
	uint32_t cfarAbsAddr;
	uint32_t framePackAddr;
	uint32_t BBE_MeanOldAddr;
	uint32_t BBE_MeanCurAddr;
	uint32_t SRAM_MeanOld1Addr;
	uint32_t SRAM_MeanOld2Addr;
	uint16_t alg0_dstInc;
	uint16_t alg25_dstInc;
	uint16_t alg26_dstInc;
	uint16_t Old1MeanCnt;
	uint16_t Old2MeanCnt;
	uint8_t copyEn;
	uint8_t copyFlashEn;
	uint8_t MeanMode;
	uint8_t cfarUseRange;
	uint8_t rsv[2];
	uint16_t crcLen;           //0630
	uint16_t crcVal;           //0632
}PARAM_ALGORITHM;


#endif
